<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html lang="en">
<head>
	<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
	<title>test</title>
	<script type="text/javascript">

		// obj = new Object();
		// obj.name = "汽车";
		// obj.length = "3M";
		// obj.run = function  () {
		// 	alert("汽车可以跑");
		// 	alert("汽车可以跑");
		// 	alert("汽车可以跑");
		// 	alert("汽车可以跑");
		// }


		// alert(obj.name);


		// obj.run();
		// 
		arr = [34,34,65,375,73,34,23,7,3,3,3,3,3,375];

		function qc (x) {
			for (var i = 0; i < x.length; i++) {
				for (var j = i+1;j<x.length; j++) {
					if(x[i]==x[j]){
						x.splice(j,1);
						j--;
					}
				};
			};
			return x;
		}

		res = qc(arr);

		// alert(res);


		arr1 = [9,6,1,9,8,5];

		//[1,4,6,8,9]
		// arr1 = [9,8,7,6,5];
		// [8,7,6,5,9];
		// [7,6,5,8,9];
		// [6,5,7,8,9];
		// [5,6,7,8,9];

		// [5,6,7,8,9]

		function ps (x) {
			for (var j = 0; j <x.length-1; j++) {
				for (var i = 0; i <x.length; i++) {

					if(x[i]>x[i+1]){
						temp = x[i+1];
						x[i+1]=x[i];
						x[i] = temp;
					}
				};
			};

			return x;

			
		}

		res = ps(arr1);

		// alert(res);


		str = "bbs.daniuit.com，论坛地址： bbs.daniuit.com, 官方网址： www.daniuit.com";

		function findStr (x,y) {

			pos = [];
			index = 0
			while(index>=0){

				if(index==0){
					index= x.indexOf(y,index);
				}else{
					index= x.indexOf(y,index+1);
				}
				
				if(index>=0){
					// x = x.replace(y,"xxxxxxx")
					pos.push(index);
				}

			}

			pos.push();

			return pos;

		}

		res = findStr(str,'daniuit');


		// alert(res);


		str = "NidfdegdHdrE";

		function UpDown (x) {
			tempstr = "";
			for (var i = 0; i < x.length; i++) {
				if(x[i]==x[i].toLowerCase()){
					tempstr +=x[i].toUpperCase()
				}else{
					tempstr +=x[i].toLowerCase();
				}
			};
			return tempstr;
		}

		res = UpDown(str);

		alert(res);



	</script>
</head>
<body>
	
</body>
</html>